﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using DTO;

namespace TimKiemDichVu
{
    public class Location
    {
        #region Attributes        
        private int _maDuLieu = 0;
        public int MaDuLieu
        {
            get { return _maDuLieu; }
            set { _maDuLieu = value; }
        }

        private int _maDichVu;
        public int MaDichVu
        {
            get { return _maDichVu; }
            set { _maDichVu = value; }
        }

        private string _tenDichVu = String.Empty;
        public string TenDichVu
        {
            get { return _tenDichVu; }
            set { _tenDichVu = value; }
        }

        private string _tenDiaDiem = String.Empty;
        public string TenDiaDiem
        {
            get { return _tenDiaDiem; }
            set { _tenDiaDiem = value; }
        }

        private string _soNha = String.Empty;
        public string SoNha
        {
            get { return _soNha; }
            set { _soNha = value; }
        }

        private string _tenDuong = String.Empty;
        public string TenDuong
        {
            get { return _tenDuong; }
            set { _tenDuong = value; }
        }

        private string _tenPhuong = String.Empty;
        public string TenPhuong
        {
            get { return _tenPhuong; }
            set { _tenPhuong = value; }
        }

        private string _tenQuanHuyen = String.Empty;
        public string TenQuanHuyen
        {
            get { return _tenQuanHuyen; }
            set { _tenQuanHuyen = value; }
        }

        private string _tenTinhThanh = String.Empty;
        public string TenTinhThanh
        {
            get { return _tenTinhThanh; }
            set { _tenTinhThanh = value; }
        }

        private double _kinhDo = 0;
        public double KinhDo
        {
            get { return _kinhDo; }
            set { _kinhDo = value; }
        }

        private double _viDo = 0;
        public double ViDo
        {
            get { return _viDo; }
            set { _viDo = value; }
        }

        private string _chuThich = String.Empty;
        public string ChuThich
        {
            get { return _chuThich; }
            set { _chuThich = value; }
        }        
        #endregion        

        public Location(DuLieuThoDTO duLieuThoDTO)
        {
            this._chuThich = duLieuThoDTO.ChuThich;
            this._kinhDo = duLieuThoDTO.KinhDo;
            this._maDuLieu = duLieuThoDTO.MaDuLieu;
            this._soNha = duLieuThoDTO.SoNha;
            this._tenDiaDiem = duLieuThoDTO.TenDiaDiem;
            this._tenDichVu = duLieuThoDTO.TenDichVu;
            this._tenDuong = duLieuThoDTO.TenDuong;
            this._tenPhuong = duLieuThoDTO.TenPhuong;
            this._tenQuanHuyen = duLieuThoDTO.TenQuanHuyen;
            this._tenTinhThanh = duLieuThoDTO.TenTinhThanh;
            this._viDo = duLieuThoDTO.ViDo;
            for (int i = 0; i < (Application.Current as App).define.DistrictNameList.Count; i++)
            {
                if (this._tenDichVu == (Application.Current as App).define.DistrictNameList[i])
                {
                    this.MaDichVu = i;
                    i = (Application.Current as App).define.DistrictNameList.Count;
                }
            }
        }
    }
}
